﻿// -----------------------------------------------------------------------
// <copyright file="Collectable.cs" company="Diddly Squad">
// </copyright>
// -----------------------------------------------------------------------

using FarseerPhysics.Dynamics;
using Microsoft.Xna.Framework.Graphics;

namespace DiddlySquat
{

	/// <summary>
	/// Class for collectables in the game. Special kind of obstacle which brings bonus points to the player.
	/// </summary>
	public class Collectable : Obstacle
	{
		/// <summary>
		/// Initializes the Collectable.
		/// </summary>
		/// <param name="world">The world.</param>
		/// <param name="xpos">The xpos.</param>
		/// <param name="ypos">The ypos.</param>
		/// <param name="density">The density.</param>
		/// <param name="rotation">The rotation.</param>
		/// <param name="sprite">The sprite.</param>
		/// <param name="obstacleType">Type of the obstacle.</param>
		public override void Initialize(World world, float xpos, float ypos, float density, float rotation, Texture2D sprite, Enums.ObstacleType obstacleType)
		{
			base.Initialize(world, xpos, ypos, density, rotation, sprite, obstacleType);
			this.ObstacleBody.BodyType = BodyType.Dynamic;
			this.ObstacleBody.IgnoreGravity = true;
			this.ObstacleBody.CollisionCategories = Constants.CollectableCollisionCategory;
			this.ObstacleBody.CollidesWith = Constants.CollectableCollidesWith;
		}
	}
}
